package lab02.test32;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by 14394 on 2017/11/13.
 */
public class Test2 {
    public static void main(String[] args) {
        Map<String,String> hashMap=new HashMap<>();
        hashMap.put("id","1");
        hashMap.put("name","张三");
        hashMap.put("gender","男");
        hashMap.put("love","爱学java");

        for (Map.Entry<String,String> tmp:hashMap.entrySet()) {
            System.out.println(tmp.getKey() + ":" + tmp.getValue());
        }
        System.out.println(hashMap.entrySet().size());
        hashMap.remove("love");
        System.out.println(hashMap.entrySet().size());
        for (Map.Entry<String,String> tmp:hashMap.entrySet()){
            System.out.println(tmp.getKey()+":"+tmp.getValue());
        }

    }
}
